package com.hfi.my;

import java.lang.reflect.Proxy;

/**
 * @author ChangLiang
 * @date 2019/5/16
 */
public class MySqlSession {

    private MyExecutor myExecutor = new MySimpleExecutor();

    public <T> T selectOne(String statement, Object parameter) {
        return myExecutor.query(statement, parameter);
    }

    public <T> T getMapper(Class<T> clazz) {
        return (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz}, new MyMapperProxy<T>(this,
                clazz));
    }
}
